import java.util.Scanner;

public class test411 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter a decimal value (0 to 15): ");
        int decimal = scanner.nextInt();

        if (decimal >= 0 && decimal <= 15) {
            String hex;
            if (decimal < 10) {
                hex = String.valueOf(decimal);
            } else {
                // 10→A, 11→B... 用ASCII码计算：'A' + (decimal-10)
                hex = String.valueOf((char) ('A' + decimal - 10));
            }
            System.out.println("The hex value is " + hex);
        } else {
            System.out.println(decimal + " is an invalid input");
        }
        scanner.close();
    }
}
